﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Media;

using Styx;
using Styx.Common;
using Styx.CommonBot;
using Styx.CommonBot.Routines;
using Styx.TreeSharp;
using Styx.WoWInternals;
using Styx.WoWInternals.DBC;
using Styx.WoWInternals.WoWObjects;
using Styx.MemoryManagement;

namespace WuzzMonk
{
    public partial class Monk : CombatRoutine
    {

        public void LowbieRotation()
        {
            #region Priority Rotation

            // Tiger Palm for keeping up buff
            if ((!Helpers.Unit.HasMyAura(Me, "Tiger Power", 3) || Me.Auras["Tiger Power"].TimeLeft.Seconds < 5)
                && Me.CurrentChi >= 1 && Me.CurrentTarget.IsWithinMeleeRange)
                if (CastSpell("Tiger Palm", Me.CurrentTarget))
                    return;

            // Blackout Kick for damage when Tiger Power is at 3 stacks
            if (Me.CurrentChi >= 2 && Me.CurrentTarget.IsWithinMeleeRange)
                if (CastSpell("Blackout Kick", Me.CurrentTarget))
                    return;

            // Jab
            if (Me.CurrentEnergy >= 40
                && Me.CurrentTarget.IsWithinMeleeRange)
                if (CastSpell("Jab", Me.CurrentTarget))
                    return;

            // Tiger Palm, for spending chi when energy is low? Only when no other Chi-spenders is learned?
            if (!SpellManager.Spells.ContainsKey("Blackout Kick")
                && Me.CurrentChi >= 1 && Me.CurrentTarget.IsWithinMeleeRange)
                if (CastSpell("Tiger Palm", Me.CurrentTarget))
                    return;

            #endregion
        }
    }
}
